/*
 *  This file is part of WWWPal.
 *
 *  Copyright (C) 2003  Dr. John Punin, Department of Computer Science
 *  Rensselaer Polytechnic Institute
 *
 *  WWWPal is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  WWWPal is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Foobar; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

/*
 *  This file is part of WWWPal.
 *
 *  Copyright (C) 2003  Dr. John Punin, Department of Computer Science
 *  Rensselaer Polytechnic Institute
 *
 *  WWWPal is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  WWWPal is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Foobar; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#ifndef LOGR_GEN_LINKS_H
#define LOGR_GEN_LINKS_H

#include <sys/stat.h>
#include <sys/fcntl.h>
#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <ctype.h>
#include <sys/time.h>
#include <assert.h>
#include <gr_graph_fun.h>

typedef enum _type_link {
    PWEBEDGE = 1, PWEBINDEPENDENTLINK
} TypeLink;

typedef struct _web_gen_link_node {
    TypeLink tl;
    void *edgeptr;
} WebGenLinkStruct;

typedef struct _web_gen_link_node *WebGenLinkPtr;

WebGenLinkPtr
new_web_gen_link(void);

void
delete_web_gen_link(WebGenLinkPtr gln);

void
LOGR_set_type_gen_link(WebGenLinkPtr gln,TypeLink tl);

TypeLink
LOGR_get_type_gen_link(WebGenLinkPtr gln);

void
LOGR_set_info_gen_link(WebGenLinkPtr gpn,void *ep);

void
LOGR_set_gen_link_from_name(WebGenLinkPtr gln, char *urls, char *urlt,
			    WebStatPtr wsf,GraphFrame *gf);

void *
LOGR_get_info_gen_link(WebGenLinkPtr gln);

long
LOGR_get_gen_link_naccesses(WebGenLinkPtr gln);

int
LOGR_is_access_gen_link_lower(WebGenLinkPtr u, WebGenLinkPtr v);

int
LOGR_is_access_gen_link_bigger(WebGenLinkPtr u,WebGenLinkPtr v);

const char *
LOGR_get_gen_url_source(WebGenLinkPtr gln);

const char *
LOGR_get_gen_url_target(WebGenLinkPtr gln);

int
LOGR_get_gen_link_source_num(WebGenLinkPtr gln);

int
LOGR_get_gen_link_target_num(WebGenLinkPtr gln);

const char *
LOGR_get_gen_title_source(WebGenLinkPtr gln);

const char *
LOGR_get_gen_title_target(WebGenLinkPtr gln);

const char *
LOGR_get_gen_mime_source(WebGenLinkPtr gln);

const char *
LOGR_get_gen_mime_target(WebGenLinkPtr gln);

int
LOGR_get_gen_size_source(WebGenLinkPtr gln);

int
LOGR_get_gen_size_target(WebGenLinkPtr gln);

int
LOGR_get_gen_naccesses_source(WebGenLinkPtr gln);

int
LOGR_get_gen_naccesses_target(WebGenLinkPtr gln);

int
LOGR_get_gen_http_code_source(WebGenLinkPtr gln);

int
LOGR_get_gen_http_code_target(WebGenLinkPtr gln);

const char *
LOGR_get_gen_link_label(WebGenLinkPtr gln);

extern void *
LOGR_find_info_gen_link(char *urls,char *urlt,TypeLink *tl,WebStatPtr wsf,
			GraphFrame *gf);

short
LOGR_is_gen_link_name(WebGenLinkPtr gln,char *urls,char *urlt);

short
LOGR_is_gen_links_equal(WebGenLinkPtr gln,WebGenLinkPtr hln);

short 
LOGR_is_gen_html_target(WebGenLinkPtr gln);

short
LOGR_is_gen_link_independent(WebGenLinkPtr gln);

#endif


